package echecs.ia;

import echecs.gen.Generateur;
import javax.swing.JApplet;

public abstract class AlphaBeta extends Generateur {

    public AlphaBeta(JApplet ref) {
        super(ref);

    }

    public void alphabeta(int start, int end) {
        //minimax
        if (deep % 2 == 0) {
            if (value > minimax[deep]) {
                minimax[deep] = value;
            }
            if (value > alphabeta[deep - 1]) {
                ababort = true;
            }
        } else {
            //computer
            if (value <= minimax[deep]) {
                minimax[deep] = value;
                if (deep == 1) {
                    move = start * 100 + end;
                }
            }
            //alphabeta
            if (value < alphabeta[deep - 1]) {
                ababort = true;
            }
        }
    }
}
